<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
    <div class="container-div">
		<div class="btn-group hidden-xs" id="toolbar" role="group">
			<a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()">
				<i class="fa fa-plus"></i> 新增模板
			</a> 
			<a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()">
				<i class="fa fa-trash-o"></i> 删除
			</a>
			&nbsp;&nbsp;
			 <a href="/tool/"   class="btn btn-primary" id="aTemplate" rel="external nofollow" >
					    <span id="spanId">下一步</span>
					 </a>
		</div>
			
		<div class="col-sm-12 select-info table-striped">
			<table id="bootstrap-table" data-mobile-responsive="true"></table>
		</div>
    </div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var prefix = ctx + "system/template"

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                modalName: "模板",
                columns: [{
		            checkbox: true
		        },
				{
					field : 'id', 
					title : '模板id' 
				},
				{
					field : 'templateName', 
					title : '模板名称' 
				},
				{
					field : 'templateUrl', 
					title : '模板路径 ' 
				},
				{
					field : 'templateType', 
					title : '创建时间 '
				},
				
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
		            	actions.push('<a class="btn btn-success btn-xs" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs " href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
						return actions.join('');
		            }
		        }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>